<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1 id="hh">DOM</h1>
<p id="demo">aaaa</p>

<script>
    var root=document.getElementsByTagName("html")[0];
    var childs=root.childNodes;
    for(var i=0;i<childs.length;i++){
        document.write(childs[i].nodeName+":"+childs[i].nodeValue+"<br>");
    }
    document.write(window.location.href+'<br>');
    window.open("http://www.baidu.com");

</script>
<!--获取标签p,更改样式-->
<button type="submit" onclick="document.getElementsByTagName('p')[0].style='font-size: larger'">请点击</button>

</body>
</html>